package com.cloud.service.impl;

import com.cloud.dao.ReagentUserDao;
import com.cloud.dao.RegionDao;
import com.cloud.pojo.ReagentUser;
import com.cloud.pojo.Region;
import com.cloud.service.ReagentUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author: Tangtao
 * @Date: 2022/4/20 18:52
 * @Description: Nucleic acid user service implementation class
 * @ClassName:  ReagentUserServiceImpl
 */

@Service
public class ReagentUserServiceImpl implements ReagentUserService {

    @Resource
    private ReagentUserDao reagentUserDao;

    @Resource
    private RegionDao regionDao;

    @Override
    public boolean saveReagentUserInfo(List<ReagentUser> list) {
        int resultInt = 0;
        for (ReagentUser reagentUser : list) {
            reagentUser.setUserId(reagentUser.getUserId());
            resultInt += reagentUserDao.saveReagentUserInfo(reagentUser);
        }
        return resultInt == list.size();
    }

    @Override
    public List<Region> getAllRegionInfo() {
        return regionDao.getRegionInfo();
    }
}
